import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/home/main'
import HomeRoutes from '../views/home/router'
import TypeRoutes from '../views/types/router'
console.log(HomeRoutes)
Vue.use(VueRouter)
const routes = [
  // z这里是首页模块的路由
  {
    path: '/',
    name: 'Main',
    component: Main,
    redirect: '/index',
    children: [
      ...HomeRoutes
    ]
  },
  // 分类模块的路由
  {
    path: '/type',
    name: "typesMain",
    component: () => import ('../views/types/main'),
    redirect: '/type/index',
    children: [
      ...TypeRoutes
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
